package com.ra.utils;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * Author : 今晚几点睡_Ada
 * Date: 2023/3/24
 * Time: 15:18
 * 注:
 */

public class ExceptionUtil {
    public static String getTrace(Throwable t) {
        StringWriter stringWriter = new StringWriter();
        PrintWriter writer = new PrintWriter(stringWriter);
        t.printStackTrace(writer);
        StringBuffer buffer = stringWriter.getBuffer();
        return buffer.toString();
    }
}
